package com.runningrookie.service;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

public interface ConcurrencyLockService {
    /**
     * 尝试加锁,事务传播级别为另起一个事务
     */
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    Boolean tryLock(String businessNode, String businessUniqueNo);

    /**
     * 解锁,事务传播级别为另起一个事务
     */
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    void unLock(String businessNode, String businessUniqueNo);
}
